from apps.picture.settings import config

if config.SERVER_ENV != 'dev':
    from gevent import monkey
    
    monkey.patch_all()
else:
    pass

from apps.picture.views.picturenumdistinguish import num

from flask_apscheduler import APScheduler
from library.api.tFlask import tflask


def create_app():
    app = tflask(config)
    register_blueprints(app)
    # scheduler = APScheduler()
    # scheduler.init_app(app)
    # scheduler.start()
    
    return app


def register_blueprints(app):
    app.register_blueprint(num, url_prefix='/v1/picture/num')


if __name__ == '__main__':
    create_app().run(port=config.PORT)
